<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
 Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
	
		parent.document.title="profileManager.js Overview";
	
}
</script>
</head>
<body bgcolor="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<center>
	
	   <h2>profileManager.js</h2>
	
</center>

	


<h4>Summary</h4>
<p>
	
		No overview generated for 'profileManager.js'<BR/><BR/>
	
</p>

<hr>


    <table border="1" cellpadding="3" cellspacing="0" width="100%">
    <tr bgcolor="#CCCCFF" class="TableHeadingColor">
    <td colspan=2><font size="+2">
    
        <b>Class Summary</b>
    
    </font></td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="profileManager.html">profileManager</a></b></td>
    <td>&nbsp;</td>
    </tr>
    
    </table>
    <hr/> 


<!-- ========== METHOD SUMMARY =========== -->

<!-- ========== END METHOD SUMMARY =========== -->


        <pre class="sourceview"><span class="comment">/**
 * It manages the creation and remotion of profiles.
 * <span class="attrib">@author</span> Roosevelt de Lima Sardinha
 * <span class="attrib">@constructor</span>
 */</span>
<span class="reserved">function</span> profileManager(){	
	<span class="comment">/**
	 * Creates a profile.
	 * <span class="attrib">@return</span> The profile that was created.
	 * <span class="attrib">@type</span> Object
	 */</span>
	<span class="reserved">this</span>.createProfile = <span class="reserved">function</span>(){
		<span class="comment">//Creates  a new Profile Object</span>
		var myProfile = new profile();
		<span class="reserved">return</span> myProfile;
	}

	<span class="comment">/**
	 * Gets a profile by its given id.
	 * <span class="attrib">@param</span> {Int} id The id of the profile.
	 * <span class="attrib">@return</span> The profile that has the given id.
	 * <span class="attrib">@type</span> {Object}
	 */</span>
	<span class="reserved">this</span>.get = <span class="reserved">function</span>(id){
		<span class="comment">// Returns a profile</span>
		var myRequest = new request();
        myRequest.sendSincRequest(<span class="literal">'GET'</span>, null, <span class="literal">"profiles/"</span> + id, <span class="reserved">function</span>(response){
            profileStr = response;
        });
		var profileJSON = JSON.parse(profileStr);
		var myProfile = new profile();
		
		myProfile.id = profileJSON.id;
		myProfile.name = profileJSON.name;
		myProfile.description = profileJSON.description;
		myProfile.types = profileJSON.type;
		
		<span class="reserved">return</span> myProfile;
	}
	
	<span class="comment">/**
	 * Gets all the profiles in the database.
	 * <span class="attrib">@return</span> An object containing all the profiles
	 * <span class="attrib">@type</span> {Object}
	 */</span>	
	<span class="reserved">this</span>.all = <span class="reserved">function</span>(){
		<span class="comment">// Returns all profiles</span>
		var myRequest = new request();
        myRequest.sendSincRequest(<span class="literal">'GET'</span>, null, <span class="literal">"profiles"</span>, <span class="reserved">function</span>(response){
            profilesStr = response;
        });
		var profilesJSON = JSON.parse(profilesStr);
		
		<span class="reserved">return</span> profilesJSON;
	}
	
	<span class="comment">/**
	 * Removes a profile from the database by its id.
	 * <span class="attrib">@param</span> {Int} id The id of the profile to be removed.
	 */</span>
	<span class="reserved">this</span>.remove = <span class="reserved">function</span>(id){
		<span class="comment">// Removes a profile by id</span>
		var myRequest = new request();
		var params = [];
		params[<span class="literal">'_method'</span>] = <span class="literal">'DELETE'</span>;
        myRequest.sendSincRequest(<span class="literal">'POST'</span>, params, <span class="literal">"profiles/"</span> + id, <span class="reserved">function</span>(response){});
	}
}
</pre>
	<hr>



<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<font size="-1">

</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Mon Feb 21 18:12:28 2011</div>
</body>
</html>
